
{% include "../header.html" %}

  
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;">
    <table class="layui-table">
  <colgroup>
    <col width="20">
    <col width="100">
    <col>
    <col>
    <col width="40">
  </colgroup>
  <thead>
    <tr>
      <th>id</th>
      <th>栏目</th>
      <th>标题</th>
      <th>时间</th>
      <th>type</th>
      <th>level</th>
      <th>管理</th>
    </tr> 
  </thead>
  <tbody>
 {% for nav in navs %}

    <tr>
      <td>{{nav.id}}</td>
      <td> {{nav.name}}</td>
      <td><a href="/nav/{{nav.id}}">{{nav.title}}</a></td>
      <td> {{nav.updateDate}}</td>
      <td> {{strtype(nav.type)}}</td>
      <td> {{nav.level}}</td>
      <td>
        <a href="/admin/nav/update/{{nav.id}}"><button class="layui-btn">修改</button></a>
        <a href="javascript:deletes({{nav.id}})"><button class="layui-btn">删除</button></a>

      </td>
    </tr>
 {% end %}
  </tbody>
</table>
    </div>
  </div>
<script>
  function deletes(id) {
      let url = "/admin/nav/del/";
       layer.confirm('真的要删除?？', {
      btn: ['删除','取消'] //按钮
      }, function(){
    getdel(url+id)
      }, function(){

      });

  }
  function getdel(url) {
      $.get(url,
      function (data,status) {
         data = JSON.parse(data)
       if(data.code === 1){
          document.location.href=""
       }
       if(data.code === 0){
            layer.msg(data.message)
       }
      })
  }
</script>
 
{% include "../footer.html" %}